package com.lzp.controller;

import com.lzp.utils.JSONResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MaxUploadSizeExceededException;

/**
 * @description: 异常捕获 API
 * @author: lzp
 * @createTime: 2021-08-01 11:53
 **/
@Controller
@RequestMapping("err")
public class ErrorController {

    @RequestMapping("error")
    public String error() {
        int a = 1 / 0;
        return "error";
    }

    @RequestMapping("/ajaxerror")
    public String ajaxerror() {
        return "thymeleaf/ajaxerror";
    }

    @RequestMapping("/getAjaxerror")
    @ResponseBody
    public JSONResult getAjaxerror() {
        int a = 1 / 0;
        return JSONResult.ok();
    }
}
